import request from '@/utils/request'

// 分页查询
export const page = (name, page, pageSize, type) => {
  return request.get('/admin/category', {
    params: {
      name: name,
      page: page,
      pageSize: pageSize,
      type: type
    }
  })
}

// 根据id查询员工
export const query = (id) => {
  return request.get(`/admin/category/${id}`)
}

// 修改分类
export const update = (updatefrom) => {
  return request.put('/admin/category', updatefrom)
}

// 启用查询禁用
export const statusCategory = (status, id) => {
  return request.post(`/admin/category/status/${status}`, id)
}

// 启用查询禁用
export const deleteCategory = (id) => {
  return request.delete(`/admin/category/${id}`)
}

export const addCategory = (from) => {
  return request.post('/admin/category/addCategory', from)
}
